package com.lifeCicle.converters;

import com.lifeCicle.entities.Notebooks;

import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;

public class NotebookConverter implements Converter {
    public NotebookConverter() {
        super();
    }

    public Object getAsObject(FacesContext facesContext,
                              UIComponent uIComponent, String string) {
        
        Notebooks n = new Notebooks();
        n.setId(Long.valueOf(string));
        n.setModelo("Bangho");
        System.out.println("NotebookConverter getAsObject: " + string);
        return n;
    }

    public String getAsString(FacesContext facesContext,
                              UIComponent uIComponent, Object object) {
        return object.toString();
    }
}
